<?php
/**
 * registro del js _form.js
 * @autor Alex Yépez <ayepez@tradesystem.com.ec>
 */
Util::tsRegisterAssetJs('_form.js');
/** @var CampaniaController $this */
/** @var Campania $model */
/** @var AweActiveForm $form */
$form = $this->beginWidget('ext.AweCrud.components.AweActiveForm', array(
    'type' => 'horizontal',
    'id' => 'campania-form',
    'enableAjaxValidation' => FALSE,
    'clientOptions' => array('validateOnSubmit' => true, 'validateOnChange' => false,),
    'enableClientValidation' => TRUE,
        ));
?>
<div class="span8">
    <div class="widget blue">
        <div class="widget-title">
            <h4><i class="icon-plus"></i><?php echo Yii::t('AweCrud.app', $model->isNewRecord ? 'Create' : 'Update') . ' ' . Campania::label(1); ?></h4>
            <span class="tools">
                <a href="javascript:;" class="icon-chevron-down"></a>
                <!--a href="javascript:;" class="icon-remove"></a-->
            </span>
        </div>
        <div class="widget-body">
            <?php echo $form->textFieldRow($model, 'nombre', array('maxlength' => 64)) ?>
            <?php echo $form->datepickerRow($model, 'fecha_inicio', array('options' => array('format' => 'dd/mm/yyyy', 'autoclose' => 'true', 'startDate' => 'today'))); ?>
            <?php echo $form->datepickerRow($model, 'fecha_fin', array('options' => array('format' => 'dd/mm/yyyy', 'autoclose' => 'true', 'startDate' => 'today'))); ?>
            <?php echo $form->dropDownListRow($model, 'nosey_form_id', array('' => ' -- Seleccione -- ') + CHtml::listData(Form::model()->findAll(), 'id', 'name'), array('class' => 'span5 fix')) ?>
        </div>                
        <div class="form-actions">
            <?php
            $this->widget('bootstrap.widgets.TbButton', array(
                'buttonType' => 'submit',
                'type' => 'success',
                'label' => $model->isNewRecord ? Yii::t('AweCrud.app', 'Create') : Yii::t('AweCrud.app', 'Save'),
            ));
            ?>
            <?php
            $this->widget('bootstrap.widgets.TbButton', array(
                'label' => Yii::t('AweCrud.app', 'Cancel'),
                'htmlOptions' => array('onclick' => 'javascript:history.go(-1)')
            ));
            ?>
        </div>
    </div>
</div>

<div class="span4">
    <div class="widget orange  ">
        <div class="widget-title">
            <h4><i class="icon-plus"></i><?php echo 'Acciones de' . ' ' . Campania::label(1); ?></h4>
            <span class="tools">
                <a href="javascript:;" class="icon-chevron-down"></a>
            </span>
        </div>
        <div class="widget-body">
            <div class="check-box-list">

                <?php
                 echo $form->labelEx($model,'accion');
                echo $form->checkBoxList($model, 'accion', Campanias_Constants::getConstants());
                echo $form->error($model, 'accion');
                ?>


            </div>        
        </div>
    </div>
</div>

<?php $this->endWidget(); ?>
